﻿@model Model.EtlTargetSystemInfo
@{
    ViewBag.Title = "EtlSourceEdit";
    Layout = "~/Views/Shared/_Main.cshtml";
}
<link href="../../CSS/PageStyle.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Validator.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<style type="text/css">
    textarea
    {
        width: 400px;
        border: 1px solid #ccc;
        padding: 2px;
    } 
</style>
<script type="text/javascript">
    function SubmitForm() {
        if ($('#ff').form("validate")) {
            $('#ff').form('submit');
            BackToList();
        }
    }

    function BackToList() {
        window.location.href = "/SystemConfiguration/EtlTargetList";
    }
    function ChickCode() {
        var v = $("#txt_TargetSysCode").val();
        $.post("/SystemConfiguration/ChickTargetCode?code=" + encodeURI(v), function (result) {
            if (result > 0) {
                $("#checkCode").html("该值己存在，请重输入！");
                $("#Save").attr("disabled", "disabled");
                //                $("#checkCode").
            } else {
                $("#Save").removeAttr("disabled", "disabled");
            }
        });
    }

    $(function () {
        if($("#hid_Guid").val()!="") {
            $("#txt_TargetSysCode").attr("readonly", "true");
            $("#txt_TargetSysCode").removeAttr("onblur");
        }
    });
</script>
<div id="p" class="easyui-panel" style="width: 800px; padding: 10px 5px 10px 5px;"
    data-options="title:'对接系统修改',iconCls:'icon-edit'">
    <form id="ff" action="/SystemConfiguration/EtlTargetUpdateData" method="post">
   <table style="width: 780px" cellpadding="0" cellspacing="0" class="table_bg">
        <colgroup>
            <col style="width: 27%;" />
            <col style="width: 73%;" />
        </colgroup>
        <tr>
            <td style="text-align: right;">
                名称：
            </td>
            <td>
                <input id="hid_Guid" name="Guid" type="hidden" value="@Model.Guid"/>
                <input type="text" id="txt_PhoneNumber" name="TargetSysName" value="@Model.TargetSysName" class="easyui-validatebox" data-options="required:true"/>
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                编码：
            </td>
            <td>
                 <div style="float: left">
                <input type="text" id="txt_TargetSysCode" name="TargetSysCode"  value="@Model.TargetSysCode" class="easyui-validatebox" data-options="required:true" onblur="ChickCode()" />
                 </div>
                 <div id="checkCode" style="float: left; color: red">
                </div>
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                数据库类型：
            </td>
            <td>
                @Html.DropDownListFor(model => model.TargetType, WebPortal.Controllers.SystemConfigurationController.DropDownListGroup("SourceType"))
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                连接字符串：
            </td>
            <td>
                <textarea id="TextArea1" cols="30" rows="3" name="Connstr" class="easyui-validatebox" data-options="required:true">@Model.Connstr</textarea>
                
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                性能（N行/秒）：
            </td>
            <td>
                <input type="text" id="txt_PhoneNumber" name="Performance"  value="@Model.Performance" class="easyui-validatebox" validType="intOrFloat" data-options="required:true"/>
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                状态：
            </td>
            <td>
                @Html.DropDownListFor(model => model.Status, WebPortal.Controllers.SystemConfigurationController.DropDownStatus())
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                线程数：
            </td>
            <td>
                <input type="text" id="txt_PhoneNumber" name="Thread"  style=" " value="@Model.Thread" class="easyui-validatebox" data-options="required:true" validType="integer" />
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                超时时间（秒）：
            </td>
            <td>
                <input type="text" id="txt_PhoneNumber" name="Timeout" value="@Model.Timeout" class="easyui-validatebox" data-options="required:true" validType="integer" />
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                描述：
            </td>
            <td>
                  <textarea id="TextArea1" cols="30" rows="3" name="TargetSysDescription" class="easyui-validatebox">@Model.TargetSysDescription</textarea>
               
            </td>
        </tr>
        <tr>
            <td style="border-top: 0px; text-align: center" colspan="2">
                  <input id="Save" type="button" value=" 保存 " onclick="SubmitForm()" />
                <input type="button" value=" 返回 " onclick="BackToList();" />
                @*<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="SubmitForm()">
                    保存</a> &nbsp;&nbsp; <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo'"
                                           onclick="BackToList()">返回</a>*@
            </td>
        </tr>
    </table>
    </form>
</div>
